import { ConsoleLogger, Module } from '@nestjs/common';
import { AuthResolver } from './auth.resolver';
import { AuthService } from './auth.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { User } from '../user/models/user.entity';
import { UserService } from '../user/user.service';
import { JwtModule } from '@nestjs/jwt';
import { JWT_SECRET } from '@/common/constants/auth';
import { JwtStrategy } from './jwt.strategy';

@Module({
  imports: [JwtModule.register({
    secret:JWT_SECRET,
    signOptions:{
        expiresIn:60*60*24*7+'s'
        // expiresIn:'60s'
    }
  }), TypeOrmModule.forFeature([User])], // 因为需要对user进行增改，所以需要导入
  providers: [JwtStrategy,ConsoleLogger, AuthResolver, AuthService, UserService], // 因为需要对user进行增改，所以需要导入UserService
  exports: [],
})
export class AuthModule {}
